<template>
  <div class="tb-wp">
    <tb-report
      :schemas="schemas"
      :columns="columns"
      :apiUrl="apiUrl"
      :tableData="tableData"
      :getData="getData"
    ></tb-report>
  </div>
</template>

<script>
import TbReport from "@/components/tb-report/index.vue";

export default {
  name: "App",
  components: { TbReport },
  data() {
    return {
      title: "首页",
      apiUrl:"/scm/api/v1/scmPurchaseContractList/list",
      schemas: [
        {
          label: "内贸合同号",
          field: "contractNo",
          component: "Input",
          placeholder: "内贸合同号",
          required: false,
          colProps: {},
        },
        {
          label: "追溯号",
          field: "traceBackNo",
          component: "Input",
          placeholder: "追溯号",
          required: false,
          colProps: {},
        },
      ],
      columns:[
      { type: 'seq', key: 'seq', width: 50, title: '序号', align: 'center', fixed: 'left' },
  { title: '内贸合同号', field: 'contractNo', key: 'contractNo', width: 120, align: 'center' },
  { title: '追溯号', field: 'traceBackNo', key: 'traceBackNo', width: 200, align: 'center' },
  { title: '商品名称', field: 'goodsName', key: 'goodsName', align: 'center', width: 120 },
  { title: '品牌', field: 'goodsBrand', key: 'goodsBrand', align: 'center', width: 120 },
  {
    title: '是否品牌保护',
    field: 'entryBrandProtectionFlag',
    key: 'entryBrandProtectionFlag',
    align: 'center',
    width: 120,
  },
  { title: '规格', field: 'goodsSpecification', key: 'goodsSpecification', align: 'center', width: 120 },
  { title: '型号', field: 'goodsModel', key: 'goodsModel', align: 'center', width: 120 },
  { title: '成交单位', field: 'tradeUnitLabel', key: 'tradeUnitLabel', align: 'center', width: 120 },
  {
    title: '报关料号',
    field: 'entryMaterialNo',
    key: 'entryMaterialNo',
    align: 'center',
    width: 120,
  },
  { title: '报关名称', field: 'entryGoodsNameCn', key: 'entryGoodsNameCn', width: 140, align: 'center' },
  { title: '成交单位', field: 'entryTradeUnitLabel', key: 'entryTradeUnitLabel', align: 'center', width: 120 },
  { title: 'HS编码', field: 'entryHsCode', key: 'entryHsCode', width: 120, align: 'center' },
  { title: '申报要素', field: 'entryDeclareElement', key: 'entryDeclareElement', width: 200 },
  { title: '海关监管条件', field: 'entryControlMa', key: 'entryControlMa', width: 200 },
  { title: '检验检疫类别', field: 'entryCiqMa', key: 'entryCiqMa', width: 200 },
  { title: '出口关税', field: 'entryExportTariff', key: 'entryExportTariff', width: 200 },
  { title: '退税率', field: 'entryTaxRefundRate', key: 'entryTaxRefundRate', width: 200 },
  { title: '法定第一计量单位', field: 'entryLegalFirstUnit', key: 'entryLegalFirstUnit', width: 200 },
  { title: '第二法定计量单位', field: 'entryLegalSecondUnit', key: 'entryLegalSecondUnit', width: 200 },
  {
    title: '原产地备案跟进状况',
    field: 'entryIdFollowUp',
    key: 'entryIdFollowUp',
    align: 'center',
    width: 160,
  },
      ],
      tableData:[]
    };
  },
  methods:{
    getData(data){
           if (this.tableData.length == 0) {
            this.tableData = data;
           } else {
            this.tableData = [...this.tableData, ...data];
          }
    }
  }
};
</script>

<style>
</style>
